const express = require('express');
const router = express.Router();
const outer = require('../handler/summary');

router.get('/list', async(req, res) => {
  const data = await outer.getRecordList(req.query);
  res.send(data);
});

router.get('/timing', async(req, res) => {
  const data = await outer.getTimingData();
  res.send(data);
});

// 获取上传记录数据
router.post('/record-data', async(req, res) => {
  const data = await outer.receiveRecordData(req.body);
  res.send(data);
});

// 更新数据
router.post('/update-data', async(req, res) => {
  const data = await outer.updateRecord(req.body);
  res.send(data);
});

// 删除记录信息
router.get('/delete', async(req, res) => {
  const data = await outer.deleteRecordData(req.query);
  res.send(data);
});

module.exports = router;